import { IsNotEmpty, IsOptional, ValidateNested } from 'class-validator';
import { Type } from 'class-transformer';
import { imgDto } from '../../dto/all-dto';

export class CreateSkuDto {

  @ValidateNested()
  @Type(() => imgDto)
  img: imgDto

  @IsNotEmpty()
  @Type(() => Number)
  price: number

  @IsNotEmpty()
  @Type(() => Number)
  stock: number

  @IsOptional()
  goodId: number

  @IsNotEmpty()
  specCombination: Record<string | number, string>

  @IsNotEmpty()
  @Type(() => Number)
  specType: number
}
